import Mock from 'mockjs'

const treeList = []
const treeCount = 30

for (let i = 0; i < treeCount; i++) {
  treeList.push(Mock.mock({
    orgId: '@increment',
    orgName: '@ctitle(3, 10)',
    'children|0-5': [
      {
        orgId: '@increment',
        orgName: '@ctitle(3, 10)',
        'children|0-5': [
          {
            orgId: '@increment',
            orgName: '@ctitle(3, 10)',
            'children|0-5': [
              {
                orgId: '@increment',
                orgName: '@ctitle(3, 10)'
              }
            ]
          }
        ]
      }
    ]
  }))
}

export default [
  {
    url: '/org/getTree',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '请求成功',
        data: {
          treeList
        }
      }
    }
  }
]
